package org.example.demo04;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

//使用字符流 读取字符串"你好,B班"的内容并写入到文件 (文件目录：C:/out01/02.txt)
public class Test01 {
    public static void main(String[] args) throws IOException {
        /*BufferedInputStream bufferedInputStream=new BufferedInputStream(new FileInputStream("C:/out01/01.txt"));
        byte[] bytes=new byte[1024];
        Integer lenhth= bufferedInputStream.read(bytes);
        BufferedOutputStream bufferedOutputStream=new BufferedOutputStream( new FileOutputStream("C:/out01/02.txt"));
         bufferedOutputStream.write(bytes,0,lenhth);*/
        String context="你好，b班";
        FileWriter fw=new FileWriter(new File("C:\\out01\\01.txt"));
        fw.append(context);
        fw.close();
        }

    }

